package general;

import java.io.IOException;
import java.io.Writer;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Alejandro
 */
public abstract class OutputProvider {
    protected Writer out;

    protected OutputProvider() {

    }

    protected OutputProvider(Writer out) {
        this.out = out;
    }

    public void setWriter(Writer out) {
        this.out = out;
    }

    public void echo(String s) {
        try {
            out.write(s);
        } catch (IOException ex) {
            Logger.getLogger(OutputProvider.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
